package com.wenwei.sharebox.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.wenwei.sharebox.R;
import com.wenwei.sharebox.base.BaseActivity;
import com.wenwei.sharebox.base.Constant;
import com.wenwei.sharebox.bean.UserShareBean;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/07/12 0012.
 */
public class ReturnGoodsActivity extends BaseActivity {
    @Bind(R.id.base_title)
    TextView baseTitle;
    @Bind(R.id.goods_name)
    TextView goodsName;
    @Bind(R.id.goods_img)
    ImageView goodsImg;

    private UserShareBean.DataBean bean;

    @Override
    public int setLayoutResourceId() {
        return R.layout.activity_return_goods;
    }

    @Override
    protected void init() {
        super.init();
        bean = (UserShareBean.DataBean) getIntent().getSerializableExtra("bean");
    }

    @Override
    protected void initView() {
        super.initView();
        baseTitle.setText("归还");
        goodsName.setText(bean.getShopName());
        Glide.with(mContext).load(bean.getShopImg()).into(goodsImg);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.base_back, R.id.sao_tv})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.base_back:
                finish();
                break;
            case R.id.sao_tv:
                Bundle checkBundle = new Bundle();
                checkBundle.putInt("qr_type", Constant.QR_TYPE_REFUND);
                checkBundle.putSerializable("bean",bean);
                goActivity(mContext, QRcodeActivity.class, checkBundle);
                break;
        }
    }
}
